package com.hsq.reflection.testReflection;

public class ReflectTest01 {
    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        Class c1 = Class.forName("com.hsq.reflection.testReflection.Employee");
        Object o = c1.newInstance();
        Employee e = new Employee();
        Class c2 = e.getClass();
        System.out.println(c2);
        System.out.println(c2 == c1);
    }
}

class Employee {
    static {
        System.out.println("Employee类被加载");
    }

    @Override
    public String toString() {
        return "Employee对象被创建";
    }
}
